home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presen…tion Library 4 (Reseller) / Apple Ref. & Pres. Lib.v4.0.iso / 1-Reference / Success Stories / Lead Information / Lead Information / stack.txt < prev   
Text File  |  1990-04-18  |  11KB  |  366 lines

  1. -- stack: in
  2. -- format: 8 (HyperCard 1)
  3. -- flags: 0x1000 (none)
  4. -- protect password hash: 0
  5. -- maximum user level: 5 (scripting)
  6. -- window: Rect(x1=0, y1=0, x2=0, y2=0)
  7. -- screen: Rect(x1=0, y1=0, x2=0, y2=0)
  8. -- card dimensions: w=512 h=342
  9. -- scroll: x=0 y=0
  10. -- background count: 4
  11. -- first background id: 3704
  12. -- card count: 7
  13. -- first card id: 3243
  14. -- list block id: 2149
  15. -- print block id: 0
  16. -- font table block id: 0
  17. -- style table block id: 0
  18. -- free block count: 2
  19. -- free size: 1920 bytes
  20. -- total size: 212992 bytes
  21. -- stack block size: 9728 bytes
  22. -- created by hypercard version: 0x02002001
  23. -- compacted by hypercard version: 0x01228000
  24. -- modified by hypercard version: 0x01228000
  25. -- opened by hypercard version: 0x01228000
  26. -- patterns[0]: 0x0000000000000000
  27. -- patterns[1]: 0x8000000008000000
  28. -- patterns[2]: 0x8800220088002200
  29. -- patterns[3]: 0x8888222288882222
  30. -- patterns[4]: 0x88AA22AA88AA22AA
  31. -- patterns[5]: 0xCCAA33AACCAA33AA
  32. -- patterns[6]: 0xEEAABBAAEEAABBAA
  33. -- patterns[7]: 0xEEBBBBEEEEBBBBEE
  34. -- patterns[8]: 0xFFBBFFEEFFBBFFEE
  35. -- patterns[9]: 0xFFBBFFFFFFBBFFFF
  36. -- patterns[10]: 0x8010022001084004
  37. -- patterns[11]: 0xFFFFFFFFFFFFFFFF
  38. -- patterns[12]: 0x8822882288228822
  39. -- patterns[13]: 0x1122448811224488
  40. -- patterns[14]: 0xC4800C6843023026
  41. -- patterns[15]: 0xB130031BD8C00C8D
  42. -- patterns[16]: 0xAA00AA00AA00AA00
  43. -- patterns[17]: 0x8822552288225522
  44. -- patterns[18]: 0x8855225588552255
  45. -- patterns[19]: 0x77DD77DD77DD77DD
  46. -- patterns[20]: 0x8000000000000000
  47. -- patterns[21]: 0xAA55AA55AA55AA55
  48. -- patterns[22]: 0xAA00AA00AA00AA00
  49. -- patterns[23]: 0x8800000088000000
  50. -- patterns[24]: 0x8814224188412214
  51. -- patterns[25]: 0x8080413E080814E3
  52. -- patterns[26]: 0x22048C7422179810
  53. -- patterns[27]: 0xBE808808EB088880
  54. -- patterns[28]: 0x25C8328964244C92
  55. -- patterns[29]: 0xA29C41BE2AC914EB
  56. -- patterns[30]: 0x40A00000040A0000
  57. -- patterns[31]: 0x8040200002040800
  58. -- patterns[32]: 0xAA00800088008000
  59. -- patterns[33]: 0xFF80808080808080
  60. -- patterns[34]: 0x081C22C180010204
  61. -- patterns[35]: 0xFF808080FF080808
  62. -- patterns[36]: 0xF87422478F172271
  63. -- patterns[37]: 0xBF00BFBFB0B0B0B0
  64. -- patterns[38]: 0xFF7FBE5DA2418000
  65. -- patterns[39]: 0xFAF5FAF5A050A050
  66. -- checksum: 0x0
  67. ----- HyperTalk script -----
  68. ------------------------------------------------------------------------
  69. --                        Stack: Lead Information                     --
  70. --                    ¬© 1989 Apple Computer, Inc. &                   --
  71. --                       ¬©1990 Medior Productions                     --
  72. --                            ¬©1989 HyperPro                          --
  73. --                                                                    --
  74. --                            3/8/90 4:01 PM                          --
  75. --                             Version: 1.1                           --
  76. --                   Based on version 1.0f5 by HyperPro               --
  77. ------------------------------------------------------------------------
  78.  
  79. -- XCMDs to follow:
  80. -- # 22291    NewItem
  81. -- # 22290    NewWindow
  82. -- # 22294    SetWindow
  83.  
  84. -- XFCNs to follow:
  85. -- # 22292    Display
  86.  
  87. ------------------------------------------------------------------------
  88.  
  89.  
  90.  
  91. on openStack
  92.   global gOrg,gConfig,gApp,gBack,gMark
  93.   if cantModify of this stack is true then
  94.     answer "Please unlock this file and the disk." with "Quit"
  95.     doMenu "Quit HyperCard"
  96.     exit openStack
  97.   end if
  98.  
  99.   put false into gorg
  100.   put false into gconfig
  101.   put false into gMark
  102.   put false into gApp
  103.   put false into gBack
  104.  
  105.   get offset("1",cd fld "status" of cd "intro")
  106.   if it ‚↠0 then
  107.     answer "Clear the previously entered lead?" with "Clear lead" or "Don‚Äôt clear"
  108.     if it is "Clear lead" then reset
  109.   end if
  110.  
  111.   choose browse tool --just to make sure
  112.   pass openStack
  113. end openStack
  114.  
  115. -------------------------------- openCard ------------------------------
  116.  
  117. on openCard
  118.   hide menubar
  119.   pass openCard
  120. end openCard
  121.  
  122. --------------------------------- DoDone -------------------------------
  123.  
  124. on DoDone
  125.   global gOrg,gMark,gBack,gApp,gconfig,myfilename
  126.   set cursor to watch
  127.  
  128.   if the heapspace <= 200000 then
  129.     get makedialog ("You do not have enough memory. "&& "Expect errors if you continue.", "Cancel","Quit")
  130.     if it is "quit" then doMenu "Quit HyperCard"
  131.   end if
  132.  
  133.   lock screen
  134.   put the short name of this cd into lastcd
  135.   go cd "Org"
  136.   send closecard to cd "Org"
  137.   go cd "Mark"
  138.   send closecard to cd "Mark"
  139.   go cd "Config"
  140.   send closecard to cd "Config"
  141.   go cd "App"
  142.   send closecard to cd "App"
  143.   go cd "Back"
  144.   send closecard to cd "Back"
  145.   go cd lastcd
  146.   unlock screen
  147.   lock screen
  148.   --check if all sections are completed
  149.   if gOrg and gMark and gBack and gApp and gconfig then
  150.  
  151.     get makedialog ("Are you sure you‚Äôre ready to create the file?" ,"No","Yes")
  152.     get last item of it
  153.     if it is "No" then
  154.       exit DoDone
  155.     end if
  156.  
  157.     --create a text file containing the data
  158.     put value of word 2 of long name of this stack into myFileName
  159.     repeat until last char of myFileName is ":"
  160.       delete last char of myFileName
  161.     end repeat
  162.  
  163.     put "Link to SS Program " after myFileName
  164.  
  165.     put 2 into counter
  166.     repeat
  167.       open file myFileName
  168.       read from file myFileName for 16384
  169.       if it is empty then
  170.         close file myFileName
  171.         exit repeat
  172.       end if
  173.       close file myFileName
  174.       if last char of myFileName ‚↠"m" then delete last char of myfilename
  175.       put myFileName & counter into myFileName
  176.       add 1 to counter
  177.     end repeat
  178.  
  179.     open file myFileName
  180.     write projectData() to file myfilename
  181.     close file myFileName
  182.  
  183.     get makedialog ("Please send the data file to Apple on Applelink." ,"OK")
  184.     get makedialog ("Enter another lead, return to Success Stories,"& " or Quit.","Quit","Return","Enter Lead")
  185.     get last item of it
  186.  
  187.     if  it is "Enter Lead" then
  188.       go first cd of this stack
  189.       unlock screen
  190.       unlock screen
  191.       wait 2 seconds
  192.       set cursor to watch
  193.       send openstack to stack
  194.     else if it is "Return" then
  195.       go cd "Introduction" of stack "Success Stories"
  196.       exit to HyperCard
  197.     else doMenu "Quit HyperCard"
  198.     --
  199.   else
  200.     answer "You did not complete all the sections." with "Quit Anyway" or "Show Me"
  201.     if it is "Quit Anyway" then
  202.       get makedialog ("Data incomplete.  No data file will be created." & " Return to Success Stories or Quit.","Return","Quit","Cancel")
  203.       get last item of it
  204.       if it is "quit" then
  205.         doMenu "Quit HyperCard"
  206.         exit DoDone
  207.       else if it is "Return" then
  208.         go cd "Introduction" of stack "Success Stories"
  209.         exit to HyperCard
  210.       end if
  211.     else
  212.       if not gOrg then go cd "Org"
  213.       else if not gMark then go cd "Mark"
  214.       else if not gConfig then go cd "Config"
  215.       else if not gApp then go cd "App"
  216.       else if not gBack then go cd "Back"
  217.     end if
  218.   end if
  219. end Dodone
  220.  
  221. ------------------------------- projectData ----------------------------
  222.  
  223. function projectData
  224. global gthefile,alldata,gtheorg,gthemark,gtheConfig,gtheApp,gtheback,myfilename
  225. put empty into gthefile
  226. put empty into alldata
  227. set cursor to watch
  228. lock screen
  229. go cd "Org"
  230. send BuildIt1 to this cd
  231. put bg fld "input" of cd "org" after alldata
  232. go cd "Mark"
  233. send BuildIt2 to this cd
  234. put bg fld "input" of cd "mark" after alldata
  235. go cd "config"
  236. send  BuildIt3 to this cd
  237. put bg fld "input" of cd "config" after alldata
  238. go cd "App"
  239. send BuildIt4 to this cd
  240. put bg fld "input" of cd "app" after alldata
  241. go cd "Back"
  242. send BuildIt5 to this cd
  243. put bg fld "input" of cd "back" after alldata
  244. return allData
  245. end projectData
  246.  
  247. ---------------------------------- reset -------------------------------
  248.  
  249. on reset
  250.   global gOrg,gConfig,gApp,GBack,gMark
  251.  
  252.   set cursor to watch
  253.  
  254.   lock screen
  255.   go cd "org"
  256.   send resetCard to cd "org"
  257.  
  258.   go cd "mark"
  259.   send resetCard to cd "mark"
  260.  
  261.   go cd "config"
  262.   send resetCard to cd "config"
  263.  
  264.   go cd "app"
  265.   send resetCard to  cd "app"
  266.  
  267.   go cd "back"
  268.   send resetCard to cd "back"
  269.  
  270.   put false into gorg
  271.   put false into gconfig
  272.   put false into gMark
  273.   put false into gApp
  274.   put false into gConfig
  275.  
  276.   go cd 1
  277.   put empty into cd fld "status"
  278.   unlock screen
  279. end reset
  280.  
  281. -------------------------------- arrowKey ------------------------------
  282.  
  283. on arrowKey
  284.   if the selectedField is empty then exit arrowKey
  285.   else
  286.     set textArrows to true
  287.     pass arrowKey
  288.   end if
  289. end arrowKey
  290.  
  291. --------------------------------- domenu -------------------------------
  292.  
  293. on domenu menu                       --// Added by Medior, Inc. 2/20/90
  294.   global RPStackName
  295.   if menu is in "Home,Quit HyperCard" and RPStackName is not empty then
  296.     set cursor to watch
  297.     put RPStackName into shortname
  298.     repeat until offset(":",shortname) = 0
  299.       delete char 1 to offset(":",shortname) of shortname
  300.     end repeat
  301.     delete last char of shortname
  302.     answer "This will return to "&shortname&"." with "Cancel" or "OK"
  303.     if it is "Cancel" then exit domenu
  304.     set cursor to watch
  305.     lock screen
  306.     go RPStackName
  307.     unlock screen with dissolve
  308.     exit domenu
  309.   else if menu is "Last" then exit doMenu
  310.   else pass doMenu
  311. end domenu
  312.  
  313.  
  314. ------------------------------- closeField -----------------------------
  315.  
  316. on closeField
  317.   put word 1 to 9999 of target into it
  318.  
  319.   repeat while first char of it is return
  320.     delete first char of it
  321.   end repeat
  322.  
  323.   repeat while last char of it is return
  324.     delete last char of it
  325.   end repeat
  326.  
  327.   put word 1 to 9999 of it into it
  328.  
  329.   put it into target
  330.   if style of the target is "scrolling"
  331.   then set scroll of the target to 0
  332. end closeField
  333.  
  334. ------------------------------- makedialog -----------------------------
  335.  
  336. function makedialog strng,btnOne,btnTwo,btnThree
  337. -- example  get makedialog ("this is a test","Enter Lead","two","three")
  338. global gAnswerDefined,sLine,selectionFlag
  339. if btnThree is not empty then
  340.   put btnOne into xbtnThree
  341.   put btnTwo into xbtnTwo
  342.   put btnThree into xbtnOne
  343. else
  344.   if btnTwo is not empty then
  345.     put btnOne into xbtnTwo
  346.     put btnTwo into xbtnOne
  347.   else
  348.     if btnOne is not empty then
  349.       put btnOne into xbtnOne
  350.     else put "Cancel" into xbtnOne
  351.   end if
  352. end if
  353. setWindow 5
  354. NewWindow 328,90,"centered",0,1,"FakeAnswer","visible"
  355. NewItem "StaticText",9,11,314,45,strng,"Chicago",12,"plain"
  356. NewItem "RoundButton",223,55,314,83,xBtnOne,13,"noCommand",""
  357. if btnTwo is not empty
  358. then NewItem "RoundButton",112,59,203,79,xBtnTwo,0,"noCommand",""
  359. if btnThree is not empty
  360. then NewItem "RoundButton",6,59,97,79,xBtnThree,46,"Command",""
  361.  
  362. get Display(0,5)
  363. if item 1 of it = "ok" then return last item of it
  364. end MakeDialog
  365.  
  366.